package com.xc.controller.agent;

import com.github.pagehelper.PageInfo;
import com.xc.common.ServerResponse;
import com.xc.service.IUserRechargeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;

/**
 * @author mipha
 * @version 1.0
 * @date 2019/3/4 6:13 PM
 */
@Controller
@RequestMapping("/agent/recharge/")
@Slf4j
public class AgentRechargeController {

    @Autowired
    IUserRechargeService iUserRechargeService;

    /**
     *  代理查询 用户 充值记录
     * @param pageNum
     * @param pageSize
     * @param realName
     * @param payChannel
     * @param state
     * @param agentId
     * @param request
     * @return
     */
    @RequestMapping("list.do")
    @ResponseBody
    public ServerResponse<PageInfo> list(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                         @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
                                         @RequestParam(value = "realName",required = false) String realName,
                                         @RequestParam(value = "payChannel",required = false) String payChannel,
                                         @RequestParam(value = "state",required = false) Integer state,
                                         @RequestParam(value = "agentId",required = false) Integer agentId,
                                         HttpServletRequest request){
        return iUserRechargeService.listByAgent(agentId,realName,payChannel,state,request,pageNum,pageSize);
    }





}
